package io;

import java.io.*;

public class HomeWork {
    public static void main(String[] args)  {
       File image = new File("D:\\Users\\zdz\\IdeaProjects\\fellow_to_other\\HomeWork\\src\\io\\view.jpg");
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(image);
            FileOutputStream fos = new FileOutputStream("D:\\Users\\zdz\\IdeaProjects\\fellow_to_other\\HomeWork\\src\\copy.jpg");
            byte[] bytes = new byte[1024];
            int read = 0;
            while ((read = fis.read(bytes)) > 0) {
                fos.write(bytes,0,read);
            }
            fos.flush();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
